// TestCpp.cpp: 定义控制台应用程序的入口点。
//

#include "stdafx.h"

#include <iostream>
using namespace std;

void insert(int place, int a);

typedef struct link {
	int nodeContent;
	link * next;
} node;
node *head, *p, *q,*t;
int coun = 1;
int main2() {
	head = (node*)malloc(sizeof(node));
	head->next = NULL;
	p = head;
	insert(1, 2);
	return 0;
}

void insert(int place, int a) {
	while (p!=NULL)
	{
		if (coun == place) {
			q = (node*)malloc(sizeof(node));
			t = p->next;
			p->next = q;
			q->nodeContent = a;
			q->next = t;
			break;
		}
		else
		{
			p = p->next;
		}
		coun++;
	}
	p = head;
}